package cn.cs.client;

import cn.cs.config.CsConfiguration;
import cn.cs.fallback.AgentOrderFallBack;
import cn.cs.fallback.AgentTypeFallBack;
import cn.cs.pojo.AgentType;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * Created by yuexl
 */
@FeignClient(name = "cs-agent-provider", configuration = CsConfiguration.class, fallback = AgentTypeFallBack.class)
public interface AgentTypeClient {

    @RequestMapping(value = "/getAgentTypeById", method = RequestMethod.POST)
    public AgentType getAgentTypeById(@RequestParam("id") String id) throws Exception;

    @RequestMapping(value = "/getAgentTypeListByMap", method = RequestMethod.POST)
    public List<AgentType> getAgentTypeListByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/getAgentTypeCountByMap", method = RequestMethod.POST)
    public Integer getAgentTypeCountByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/addAgentType", method = RequestMethod.POST)
    public Integer addAgentType(@RequestBody AgentType agentType) throws Exception;

    @RequestMapping(value = "/modifyAgentType", method = RequestMethod.POST)
    public Integer modifyAgentType(@RequestBody AgentType agentType) throws Exception;

    @RequestMapping(value = "/deleteAgentTypeById", method = RequestMethod.POST)
    public Integer deleteAgentTypeById(@RequestParam("id") String id) throws Exception;

}

